#include <iostream>
#include <array>
#include <vector>
#include <string>
#include <random>
#include <chrono>
#include <algorithm>

constexpr int SIZE = {50000};

void generateData(std::array<int, SIZE> &intArray,
                  std::array<long long, SIZE> &longLongArray,
                  std::array<std::string, SIZE> &stringArray,
                  std::array<float, SIZE> &floatArray,
                  std::array<double, SIZE> &doubleArray,
                  std::vector<int> &intVector,
                  std::vector<long long> &longLongVector,
                  std::vector<std::string> &stringVector,
                  std::vector<float> &floatVector,
                  std::vector<double> &doubleVector,
                  int A)
{
  std::mt19937 generator(time(0));
  std::uniform_int_distribution<int> intDist(0, 10000);
  std::uniform_real_distribution<float> floatDist(0.0f, 10000.0f);
  std::uniform_real_distribution<double> doubleDist(0.0, 10000.0);
  std::uniform_int_distribution<long long> longLongDist(1000000000, 9999999999);
  std::string charset = "abcdefghijklmnopqrstuvwxyz";

  for (auto &num : intArray)
    num = intDist(generator);
  for (auto &num : longLongArray)
    num = longLongDist(generator);
  for (auto &num : floatArray)
    num = floatDist(generator);
  for (auto &num : doubleArray)
    num = doubleDist(generator);

  for (auto &num : intVector)
    num = intDist(generator);
  for (auto &num : longLongVector)
    num = longLongDist(generator);
  for (auto &num : floatVector)
    num = floatDist(generator);
  for (auto &num : doubleVector)
    num = doubleDist(generator);

  for (int i = 0; i < SIZE; ++i)
    longLongVector.push_back(longLongDist(generator));

  for (int i = 0; i < SIZE; ++i)
  {
    std::string str;
    for (int j = 0; j < 6; ++j)
      str += charset[generator() % charset.size()];
    stringVector.push_back(str);
  }
}

template <typename T>
size_t findSmallest(T arr[], size_t start)
{
  size_t smallestIdx = start;
  for (size_t i = start + 1; i < SIZE; ++i)
  {
    if (arr[i] < arr[smallestIdx])
    {
      smallestIdx = i;
    }
  }
  return smallestIdx;
}

template <typename T>
void selectionSort(T arr[])
{
  size_t i = 0;
  do
  {
    size_t smallestIdx = findSmallest(arr, i, SIZE);
    if (i != smallestIdx)
    {
      swap(arr[i], arr[smallestIdx]);
    }
    ++i;
  } while (i < SIZE - 1);
}

int main()
{
  static std::array<int, SIZE> intArray;
  static std::array<long long, SIZE> longLongArray;
  static std::array<std::string, SIZE> stringArray;
  static std::array<float, SIZE> floatArray;
  static std::array<double, SIZE> doubleArray;

  static std::vector<int> intVector;
  static std::vector<long long> longLongVector;
  static std::vector<std::string> stringVector;
  static std::vector<float> floatVector;
  static std::vector<double> doubleVector;



  generateData(intArray, longLongArray, stringArray, floatArray, doubleArray, intVector, longLongVector, stringVector, floatVector, doubleVector, SIZE);

  return 0;
}
